# snippet  "description"

# endsnippet

snippet il "``"
\`$1\`$0
endsnippet

snippet str "str"
&'a str $0
endsnippet

snippet stt "stuct tuple"
struct ${1:StructName}(${2:i32});$0
endsnippet

snippet > "=>"
$1 => $0,
endsnippet

################################################################################
#                                     impl                                     #
################################################################################

snippet impl "Struct/Trait implementation"
impl ${1:Type/Trait} for ${2:Type} {
	${0}
}
endsnippet

snippet impld "impl fmt::Dispaly"
impl fmt::Display for ${1:CustomType} {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "${2:\{\}}", ${3:self.0})
    }
}
endsnippet

snippet implfrom "impl From"
impl From<${1:Type}> for ${2:CustomType} {
    fn from(item: $1) -> Self {
        $0
    }
}
endsnippet

# snippet impltostring "impl ToString"
# impl ToString for ${1:CustomType} {
#     fn to_string(&self) -> String {
#         format!("${2}", $0)
#     }
# }
# endsnippet
